package com.lyx.exercise_io;

import java.io.*;

public class WriteLog {
    public static void main(String[] args) {
        String str = "";
        String filepath = "c:\\developer\\myTest.txt";
        try {
            InputStream is = System.in;
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            //BufferedWriter bw = new BufferedWriter(new FileWriter(filepath));
            PrintWriter pw = new PrintWriter(new FileWriter(filepath));
            while (!(str = br.readLine()).equals("quit#")) {
                pw.println(str);
//                bw.write(str,0,str.length());
//                bw.newLine();
            }
            //bw.close();
            pw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }
}
